<template>
    <div class="box">
        <el-scrollbar>
            <!-- <RouterView v-slot="{ Component }">
                <component :is="Component" />
            </RouterView> -->
            <div style="width: 2000px;height: 2000px;"> 4</div>
        </el-scrollbar>
    </div>
</template>
<script setup>
import { ref, getCurrentInstance, watch } from 'vue';
import { storeToRefs } from 'pinia';
import { piniaMainStore } from '../../../store/mainStore'
const pinaData = piniaMainStore() // 引入主仓库
let { navInfo } = storeToRefs(pinaData) // 变为响应式
const { proxy } = getCurrentInstance()
// let navData = JSON.parse(window.localStorage.getItem('permissions')) // 整体数据
// console.log(navData);

// watch(
//     () => navInfo.value,
//     (newVal, oldVal) => {
//         if (newVal.sub != undefined) {
//             if (newVal != oldVal) {
//                 console.log(newVal.sub);
//             }
//         }
//     },
//     { deep: true, immediate: true }
// )

function loadContent(e) { // 加载子路由 动态路由
    // proxy.$router.addRoute({ path: e.path, component: () => import('./' + e.component) })
    // proxy.$router.addRoute({ path: e.path, component: () => defineAsyncComponent(() => import('./' + e.component)) })
    proxy.$router.push({ path: e.path })
    // let pageTitle = JSON.parse(window.sessionStorage.getItem('pageTitle'))
    pageTitle.sub = e.permission_name
    // window.sessionStorage.setItem('pageTitle', JSON.stringify(pageTitle))
}
function loadwhich(e) {
    // console.log(e);
}
</script>
<style scoped>
.box {
    display: flex;
    height: calc(100vh - 60px);
}
</style>